package com.alpha.processor.processor.anno_processor;

import com.alpha.binder.anno.motion.ClickAspect;
import com.alpha.processor.processor.tools.ProcessorTool;
import com.alpha.processor.processor.anno_processor.base.AnnoProcessor;

import java.util.Set;

import javax.annotation.processing.Messager;
import javax.annotation.processing.RoundEnvironment;
import javax.lang.model.element.Element;
import javax.lang.model.util.Elements;

public class ClickAspectAnnoProcessor extends AnnoProcessor {

    private Element clickAspectElement;

    public ClickAspectAnnoProcessor(Messager messager, Elements elementUtils, ProcessorTool logger) {
        super(messager, elementUtils, logger);
    }

    @Override
    public void processAnno(RoundEnvironment roundEnvironment) {
        Set<? extends Element> elementSet = roundEnvironment.getElementsAnnotatedWith(ClickAspect.class);
        for (Element element : elementSet) {
            clickAspectElement = element;
            break;
        }
    }

    public Element getClickAspectElement() {
        return clickAspectElement;
    }
}
